

var scanCodeCallback = null;
var getUserInfoCallback = null;
var closeAppCallback = null;

const H5BridgeApi = {
     scanCode: function(callBack){



        scanCodeCallback = callBack;
    
        window.H5AppBridge.callScanCode &&  window.H5AppBridge.callScanCode();
        
    
    
    },
    
    H5BridgeScanCodeResult: function (res){
        // alert("H5BridgeScanCodeResult")
        if(scanCodeCallback !== null){
            scanCodeCallback(res)
            scanCodeCallback = null
        }
    },
    
    
   getUserInfo: function (callback){
    
        // alert("getUserInfoCall")
        getUserInfoCallback = callback
        var data = {}
    
        window.H5AppBridge.callGetUserInfo &&  window.H5AppBridge.callGetUserInfo(data);
    },
    
    H5BridgeGetUserInfoResult: function (data){

        // alert("H5BridgeGetUserInfoResult:" + data)
        if(getUserInfoCallback !== null){
            getUserInfoCallback(data)
            getUserInfoCallback = null
        }
    },
    
    setNavTitle: function(isShow, title){
    
    },
    
    closeApp: function (){
    
    }
};

window.bridgeApi = H5BridgeApi;


